package com.base.service.web.controller;

import com.base.genid.generator.UidGenerator;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GenIdController {

    @DubboReference(version = "0.0.1-beta",group = "cached-uid",check = false,retries = 3)
    private UidGenerator uidGenerator;


    @RequestMapping("/genid")
    public String genId() throws Exception {
        return String.valueOf(uidGenerator.getUID());
    }
}
